package com.wyx.suanfa;

import java.util.Scanner;

/**
 * @author 王艺锡
 * @version 1.0
 */
public class rightReverse {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //输入反转字符个数
        int n = Integer.parseInt(scanner.nextLine());
        //输入字符串
        String str = scanner.nextLine();


        int len = str.length();
        char ch[] = str.toCharArray();
        //整体反转
        reverse(ch, 0, len - 1);
        //反转前一部分
        reverse(ch, 0, n - 1);
        //反转后一部分
        reverse(ch, n, len - 1);
        System.out.println(ch);


    }

    //编写方法，反转字符串
    public static void reverse(char ch[], int start, int end) {
        while (start < end) {
            char temp = ch[start];
            ch[start] = ch[end];
            ch[end] = temp;
            start++;
            end--;
        }
    }
}